package com.bluefoxyu;

import com.bluefoxyu.common.URL;
import com.bluefoxyu.impl.SnakeGameServiceImpl;
import com.bluefoxyu.protocol.HttpServer;
import com.bluefoxyu.register.LocalRegister;
import com.bluefoxyu.register.MapRemoteRegister;
import com.bluefoxyu.service.SnakeGameService;

public class SnakeGameProvider {
    public static void main(String[] args) {
        LocalRegister.regist(SnakeGameService.class.getName(), "1.0", SnakeGameServiceImpl.class);
        // 注册中心注册 服务注册
        URL url = new URL("localhost", 8888);
        MapRemoteRegister.regist(SnakeGameService.class.getName(), url);

        // Netty、Tomcat
        HttpServer httpServer = new HttpServer();
        httpServer.start(url.getHostname(), url.getPort());

    }
}